package com.lwc.config;

import com.lwc.interceptor.AuthIntercepor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 拦截器
 */
@Configuration
public class MvcConfig implements WebMvcConfigurer {


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
       registry.addInterceptor(new AuthIntercepor())
               .addPathPatterns("/**")  //拦截请求
               .excludePathPatterns("");  //放行请求
    }
}
